import axios from 'axios';

const API_BASE = 'http://localhost:8000';

export const getBills = () => axios.get(`${API_BASE}/bills/`).then(res => res.data);
export const getBill = (id) => axios.get(`${API_BASE}/bills/${id}`).then(res => res.data);
export const createBill = (bill) => axios.post(`${API_BASE}/bills/`, bill).then(res => res.data);
export const updateBill = (id, bill) => axios.put(`${API_BASE}/bills/${id}`, bill).then(res => res.data);
export const deleteBill = (id) => axios.delete(`${API_BASE}/bills/${id}`).then(res => res.data);
export const exportBills = () => axios.get(`${API_BASE}/export/`, { responseType: 'blob' }); 